#!/usr/bin/env python
PACKAGE = "roboteq_control"

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

gen.add("ratio",  double_t, 0, "[#] Gear ratio",                   1,  0)

rotation = gen.enum([ gen.const("Clockwise",        int_t, -1, "Clockwise rotation"),
                      gen.const("Counterclockwise", int_t,  1, "Counterclockwise rotation")],
                      "Rotation versus wheel")
gen.add("rotation", int_t, 0, "Versus of the rotation of the motor", 1, -1, 1, edit_method=rotation)

stall = gen.enum([ gen.const("Disabled",        int_t, 0, "Disabled"),
                   gen.const("250ms_at_10percent", int_t,  1, "250ms at 10% power"),
		   gen.const("500ms_at_25percent", int_t,  2, "500ms at 25% power"),
	           gen.const("1000ms_at_50percent", int_t,  3, "1000ms at 50% power")],
                      "Stall configuration")
gen.add("stall_detection", int_t, 0, "Stall detection", 1, 0, 3, edit_method=stall)

gen.add("amper_limit",  double_t, 0, "[A] Amper limit",    5,  1, 20)

gen.add("max_forward",       int_t, 0, "[%] IN MODULE - Maximum power forward",          100, 0, 100)
gen.add("max_reverse",       int_t, 0, "[%] IN MODULE - Maximum power reverse",          100, 0, 100)

gen.add("max_speed",  double_t, 0, "[RPM] max motor speed (after gear reduction)",    10,  0)
gen.add("max_acceleration",  double_t, 0, "[RPM/s] max motor acceleration (after gear reduction)",    1000,  0)
gen.add("max_deceleration",  double_t, 0, "[RPM/s] max motor deceleration (after gear reduction)",    1000,  0)

#Default command
gen.add("load_roboteq", bool_t  , 0, "Load all parameters from Roboteq board", False)
gen.add("restore_defaults", bool_t  , 0, "Restore to the original configuration", False)

exit(gen.generate(PACKAGE, "roboteq_node", "RoboteqParameter"))
